<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据解密工具</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/visualization.css') }}">
</head>
<body>
    {% include '_header.html' %}
    
    <div class="container">
        <h1>数据解密</h1>
        <form id="decryptForm" method="POST" class="decrypt-form">
            <div class="form-group">
                <label for="ciphertext">输入密文：</label>
                <textarea id="ciphertext" name="ciphertext" required rows="5"></textarea>
            </div>
            <div class="form-group">
                <label for="key">解密密钥：</label>
                <input type="text" id="key" name="key" required 
                       placeholder="AES: 16/24/32字符, DES: 8字符, 3DES: 16/24字符">
                <small class="hint">密钥长度提示将根据所选算法变化</small>
            </div>
            <div class="form-group">
                <label for="algorithm">解密算法：</label>
                <select id="algorithm" name="algorithm" required>
                    <option value="aes">AES解密</option>
                    <option value="des">DES解密</option>
                    <option value="3des">3DES解密</option>
                    <option value="rc4">RC4解密</option>
                    <option value="rabbit">Rabbit解密</option>
                    <option value="md5">MD5验证</option>
                    <option value="base64">Base64解码</option>
                </select>
            </div>
            <button type="submit" class="submit-btn">开始解密</button>
        </form>



        {% if plaintext %}
        <div class="result-visual">
            <div class="result-text">
                <h3>解密后的数据：</h3>
                <textarea readonly class="result-area">{{ plaintext }}</textarea>
            </div>
        </div>
        {% endif %}
    </div>

    <script>
        // 保留算法选择提示逻辑
        document.getElementById('algorithm').addEventListener('change', function() {
            const hint = {
                'aes': '请输入16、24或32个字符的密钥',
                'des': '请输入8个字符的密钥',
                '3des': '请输入16或24个字符的密钥',
                'rc4': '密钥长度不限，建议至少8个字符',
                'rabbit': '密钥长度不限，建议至少8个字符',
                'md5': '不需要密钥',
                'base64': '不需要密钥'
            };
            document.querySelector('.hint').textContent = hint[this.value];
        });

            // 修改表单提交处理，只保留基本功能
            document.getElementById('decryptForm').addEventListener('submit', function(e) {
                const ciphertext = document.getElementById('ciphertext').value;
                const key = document.getElementById('key').value;
                
                if(ciphertext && key) {
                    document.getElementById('processing').style.display = 'block';
                    e.target.querySelector('button[type="submit"]').disabled = true;
                    // 删除所有可视化相关代码
                }
            });
    </script>

    <!-- 删除所有可视化相关的script标签 -->
    <!-- ... existing code ... -->